home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / calc202a.lha / calc-2.02a / calc-help.el < prev    next >
Lisp/Scheme  |  1993-06-01  |  22KB  |  684 lines

  1. ;; Calculator for GNU Emacs, part II [calc-help.el]
  2. ;; Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
  3. ;; Written by Dave Gillespie, daveg@synaptics.com.
  4.  
  5. ;; This file is part of GNU Emacs.
  6.  
  7. ;; GNU Emacs is distributed in the hope that it will be useful,
  8. ;; but WITHOUT ANY WARRANTY.  No author or distributor
  9. ;; accepts responsibility to anyone for the consequences of using it
  10. ;; or for whether it serves any particular purpose or works at all,
  11. ;; unless he says so in writing.  Refer to the GNU Emacs General Public
  12. ;; License for full details.
  13.  
  14. ;; Everyone is granted permission to copy, modify and redistribute
  15. ;; GNU Emacs, but only under the conditions described in the
  16. ;; GNU Emacs General Public License.   A copy of this license is
  17. ;; supposed to have been given to you along with GNU Emacs so you
  18. ;; can know your rights and responsibilities.  It should be in a
  19. ;; file named COPYING.  Among other things, the copyright notice
  20. ;; and this notice must be preserved on all copies.
  21.  
  22.  
  23.  
  24. ;; This file is autoloaded from calc-ext.el.
  25. (require 'calc-ext)
  26.  
  27. (require 'calc-macs)
  28.  
  29. (defun calc-Need-calc-help () nil)
  30.  
  31.  
  32. (defun calc-help-prefix (arg)
  33.   "This key is the prefix for Calc help functions.  See calc-help-for-help."
  34.   (interactive "P")
  35.   (or calc-dispatch-help (sit-for echo-keystrokes))
  36.   (let ((key (calc-read-key-sequence
  37.           (if calc-dispatch-help
  38.           "Calc Help options: Help, Info, Tutorial, Summary; Key, Function; ?=more"
  39.         (format "%s  (Type ? for a list of Calc Help options)"
  40.             (key-description (this-command-keys))))
  41.           calc-help-map)))
  42.     (setq key (lookup-key calc-help-map key))
  43.     (message "")
  44.     (if key
  45.     (call-interactively key)
  46.       (beep)))
  47. )
  48.  
  49. (defun calc-help-for-help (arg)
  50.   "You have typed `h', the Calc help character.  Type a Help option:
  51.  
  52. B  calc-describe-bindings.  Display a table of all key bindings.
  53. H  calc-full-help.  Display all `?' key messages at once.
  54.  
  55. I  calc-info.  Read the Calc manual using the Info system.
  56. T  calc-tutorial.  Read the Calc tutorial using the Info system.
  57. S  calc-info-summary.  Read the Calc summary using the Info system.
  58.  
  59. C  calc-describe-key-briefly.  Look up the command name for a given key.
  60. K  calc-describe-key.  Look up a key's documentation in the manual.
  61. F  calc-describe-function.  Look up a function's documentation in the manual.
  62. V  calc-describe-variable.  Look up a variable's documentation in the manual.
  63.  
  64. N  calc-view-news.  Display Calc history of changes.
  65.  
  66. C-c  Describe conditions for copying Calc.
  67. C-d  Describe how you can get a new copy of Calc or report a bug.
  68. C-w  Describe how there is no warranty for Calc."
  69.   (interactive "P")
  70.   (if calc-dispatch-help
  71.       (let (key)
  72.     (save-window-excursion
  73.       (describe-function 'calc-help-for-help)
  74.       (select-window (get-buffer-window "*Help*"))
  75.       (while (progn
  76.            (message "Calc Help options: Help, Info, ...  press SPC, DEL to scroll, C-g to cancel")
  77.            (memq (setq key (read-char)) '(?  ?\C-h ?\C-? ?\C-v ?\M-v)))
  78.         (condition-case err
  79.         (if (memq key '(?  ?\C-v))
  80.             (scroll-up)
  81.           (scroll-down))
  82.           (error (beep)))))
  83.     (setq unread-command-char key)
  84.     (calc-help-prefix nil))
  85.     (let ((calc-dispatch-help t))
  86.       (calc-help-prefix arg)))
  87. )
  88.  
  89. (defun calc-describe-copying ()
  90.   (interactive)
  91.   (calc-info)
  92.   (Info-goto-node "Copying")
  93. )
  94.  
  95. (defun calc-describe-distribution ()
  96.   (interactive)
  97.   (calc-info)
  98.   (Info-goto-node "Reporting Bugs")
  99. )
  100.  
  101. (defun calc-describe-no-warranty ()
  102.   (interactive)
  103.   (calc-info)
  104.   (Info-goto-node "Copying")
  105.   (let ((case-fold-search nil))
  106.     (search-forward "     NO WARRANTY"))
  107.   (beginning-of-line)
  108.   (recenter 0)
  109. )
  110.  
  111. (defun calc-describe-bindings ()
  112.   (interactive)
  113.   (describe-bindings)
  114.   (save-excursion
  115.     (set-buffer "*Help*")
  116.     (goto-char (point-min))
  117.     (if (search-forward "Global bindings:" nil t)
  118.     (delete-region (match-beginning 0) (point-max)))
  119.     (goto-char (point-min))
  120.     (while (re-search-forward "\n[a-z] ESC" nil t)
  121.       (end-of-line)
  122.       (delete-region (match-beginning 0) (point)))
  123.     (goto-char (point-min))
  124.     (while (re-search-forward "\nESC m" nil t)
  125.       (end-of-line)
  126.       (delete-region (match-beginning 0) (point)))
  127.     (goto-char (point-min))
  128.     (while (search-forward "\n\n\n" nil t)
  129.       (backward-delete-char 1)
  130.       (backward-char 2))
  131.     (goto-char (point-min))
  132.     (while
  133.     (re-search-forward
  134.      "\n[a-z] [0-9]\\(\t\t.*\n\\)\\([a-z] [0-9]\\1\\)*[a-z] \\([0-9]\\)\\1"
  135.      nil t)
  136.       (let ((dig1 (char-after (1- (match-beginning 1))))
  137.         (dig2 (char-after (match-beginning 3))))
  138.     (delete-region (match-end 1) (match-end 0))
  139.     (goto-char (match-beginning 1))
  140.     (delete-backward-char 1)
  141.     (delete-char 1)
  142.     (insert (format "%c .. %c" (min dig1 dig2) (max dig1 dig2)))))
  143.     (goto-char (point-min)))
  144. )
  145.  
  146. (defun calc-describe-key-briefly (key)
  147.   (interactive "kDescribe key briefly: ")
  148.   (calc-describe-key key t)
  149. )
  150.  
  151. (defun calc-describe-key (key &optional briefly)
  152.   (interactive "kDescribe key: ")
  153.   (let ((defn (if (eq (key-binding key) 'calc-dispatch)
  154.           (let ((key2 (calc-read-key-sequence
  155.                    (format "Describe key briefly: %s-"
  156.                        (key-description key))
  157.                    calc-dispatch-map)))
  158.             (setq key (concat key key2))
  159.             (lookup-key calc-dispatch-map key2))
  160.         (if (eq (key-binding key) 'calc-help-prefix)
  161.             (let ((key2 (calc-read-key-sequence
  162.                  (format "Describe key briefly: %s-"
  163.                      (key-description key))
  164.                  calc-help-map)))
  165.               (setq key (concat key key2))
  166.               (lookup-key calc-help-map key2))
  167.           (key-binding key))))
  168.     (inv nil)
  169.     (hyp nil))
  170.     (while (or (equal key "I") (equal key "H"))
  171.       (if (equal key "I")
  172.       (setq inv (not inv))
  173.     (setq hyp (not hyp)))
  174.       (setq key (read-key-sequence (format "Describe key%s:%s%s "
  175.                        (if briefly " briefly" "")
  176.                        (if inv " I" "")
  177.                        (if hyp " H" "")))
  178.         defn (key-binding key)))
  179.     (let ((desc (key-description key))
  180.       target)
  181.       (if (string-match "^ESC " desc)
  182.       (setq desc (concat "M-" (substring desc 4))))
  183.       (while (string-match "^M-# \\(ESC \\|C-\\)" desc)
  184.     (setq desc (concat "M-# " (substring desc (match-end 0)))))
  185.       (if briefly
  186.       (let ((msg (save-excursion
  187.                (set-buffer (get-buffer-create "*Calc Summary*"))
  188.                (if (= (buffer-size) 0)
  189.                (progn
  190.                  (message "Reading Calc summary from manual...")
  191.                  (save-window-excursion
  192.                    (save-excursion
  193.                  (calc-info)
  194.                  (Info-goto-node "Summary")
  195.                  (goto-char (point-min))
  196.                  (forward-line 1)
  197.                  (copy-to-buffer "*Calc Summary*"
  198.                          (point) (point-max))
  199.                  (Info-last)))
  200.                  (setq case-fold-search nil)
  201.                  (re-search-forward "^\\(.*\\)\\[\\.\\. a b")
  202.                  (setq calc-summary-indentation
  203.                    (- (match-end 1) (match-beginning 1)))))
  204.                (goto-char (point-min))
  205.                (setq target (if (and (string-match "[0-9]\\'" desc)
  206.                          (not (string-match "[d#]" desc)))
  207.                     (concat (substring desc 0 -1) "0-9")
  208.                       desc))
  209.                (if (re-search-forward
  210.                 (format "\n%s%s%s%s[ a-zA-Z]"
  211.                     (make-string (+ calc-summary-indentation 9)
  212.                          ?\.)
  213.                     (if (string-match "M-#" desc) "   "
  214.                       (if inv
  215.                       (if hyp "I H " "  I ")
  216.                     (if hyp "  H " "    ")))
  217.                     (regexp-quote target)
  218.                     (make-string (max (- 6 (length target)) 0)
  219.                          ?\ ))
  220.                 nil t)
  221.                (let (pt)
  222.                  (beginning-of-line)
  223.                  (forward-char calc-summary-indentation)
  224.                  (setq pt (point))
  225.                  (end-of-line)
  226.                  (buffer-substring pt (point)))))))
  227.         (if msg
  228.         (let ((args (substring msg 0 9))
  229.               (keys (substring msg 9 19))
  230.               (prompts (substring msg 19 38))
  231.               (notes "")
  232.               (cmd (substring msg 40))
  233.               msg)
  234.           (if (string-match "\\` +" args)
  235.               (setq args (substring args (match-end 0))))
  236.           (if (string-match " +\\'" args)
  237.               (setq args (substring args 0 (match-beginning 0))))
  238.           (if (string-match "\\` +" keys)
  239.               (setq keys (substring keys (match-end 0))))
  240.           (if (string-match " +\\'" keys)
  241.               (setq keys (substring keys 0 (match-beginning 0))))
  242.           (if (string-match " [0-9,]+\\'" prompts)
  243.               (setq notes (substring prompts (1+ (match-beginning 0)))
  244.                 prompts (substring prompts 0 (match-beginning 0))))
  245.           (if (string-match " +\\'" prompts)
  246.               (setq prompts (substring prompts 0 (match-beginning 0))))
  247.           (if (string-match "\\` +" prompts)
  248.               (setq prompts (substring prompts (match-end 0))))
  249.           (setq msg (format
  250.                  "%s:  %s%s`%s'%s%s %s%s"
  251.                  (if (string-match
  252.                   "\\`\\(calc-[-a-zA-Z0-9]+\\) *\\(.*\\)\\'"
  253.                   cmd)
  254.                  (prog1 (math-match-substring cmd 1)
  255.                    (setq cmd (math-match-substring cmd 2)))
  256.                    defn)
  257.                  args (if (equal args "") "" " ")
  258.                  keys
  259.                  (if (equal prompts "") "" " ") prompts
  260.                  (if (equal cmd "") "" " => ") cmd))
  261.           (message "%s%s%s runs %s%s"
  262.                (if inv "I " "") (if hyp "H " "") desc
  263.                msg
  264.                (if (equal notes "") ""
  265.                  (format "  (?=notes %s)" notes)))
  266.           (let ((key (read-char)))
  267.             (if (eq key ??)
  268.             (if (equal notes "")
  269.                 (message "No notes for this command")
  270.               (while (string-match "," notes)
  271.                 (aset notes (match-beginning 0) ? ))
  272.               (setq notes (sort (car (read-from-string
  273.                           (format "(%s)" notes)))
  274.                         '<))
  275.               (with-output-to-temp-buffer "*Help*"
  276.                 (princ (format "%s\n\n" msg))
  277.                 (set-buffer "*Calc Summary*")
  278.                 (re-search-forward "^ *NOTES")
  279.                 (while notes
  280.                   (re-search-forward
  281.                    (format "^ *%d\\. " (car notes)))
  282.                   (beginning-of-line)
  283.                   (let ((pt (point)))
  284.                 (forward-line 1)
  285.                 (or (re-search-forward "^ ? ?[0-9]+\\. " nil t)
  286.                     (goto-char (point-max)))
  287.                 (beginning-of-line)
  288.                 (princ (buffer-substring pt (point))))
  289.                   (setq notes (cdr notes)))
  290.                 (print-help-return-message)))
  291.               (setq unread-command-char key))))
  292.           (if (or (null defn) (integerp defn))
  293.           (message "%s is undefined" desc)
  294.         (message "%s runs the command %s"
  295.              desc
  296.              (if (symbolp defn) defn (prin1-to-string defn))))))
  297.     (if inv (setq desc (concat "I " desc)))
  298.     (if hyp (setq desc (concat "H " desc)))
  299.     (calc-describe-thing desc "Key Index" nil
  300.                  (string-match "[A-Z][A-Z][A-Z]" desc)))))
  301. )
  302.  
  303. (defun calc-describe-function (&optional func)
  304.   (interactive)
  305.   (or func
  306.       (setq func (intern (completing-read "Describe function: "
  307.                       obarray nil t "calcFunc-"))))
  308.   (setq func (symbol-name func))
  309.   (if (string-match "\\`calc-." func)
  310.       (calc-describe-thing func "Command Index")
  311.     (calc-describe-thing (if (string-match "\\`calcFunc-." func)
  312.                  (substring func 9)
  313.                func)
  314.              "Function Index"))
  315. )
  316.  
  317. (defun calc-describe-variable (&optional var)
  318.   (interactive)
  319.   (or var
  320.       (setq var (intern (completing-read "Describe variable: "
  321.                      obarray nil t "var-"))))
  322.   (setq var (symbol-name var))
  323.   (calc-describe-thing var "Variable Index"
  324.                (if (string-match "\\`var-." var)
  325.                (substring var 4)
  326.              var))
  327. )
  328.  
  329. (defun calc-describe-thing (thing where &optional target not-quoted)
  330.   (message "Looking for `%s' in %s..." thing where)
  331.   (let ((savewin (current-window-configuration)))
  332.     (calc-info)
  333.     (Info-goto-node where)
  334.     (or (let ((case-fold-search nil))
  335.       (re-search-forward (format "\n\\* +%s: \\(.*\\)\\."
  336.                      (regexp-quote thing))
  337.                  nil t))
  338.     (and (string-match "\\`\\([a-z ]*\\)[0-9]\\'" thing)
  339.          (re-search-forward (format "\n\\* +%s[01]-9: \\(.*\\)\\."
  340.                     (substring thing 0 -1))
  341.                 nil t)
  342.          (setq thing (format "%s9" (substring thing 0 -1))))
  343.     (progn
  344.       (Info-last)
  345.       (set-window-configuration savewin)
  346.       (error "Can't find `%s' in %s" thing where)))
  347.     (let (Info-history)
  348.       (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1))))
  349.     (or (let ((case-fold-search nil))
  350.       (or (search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'"
  351.                       (or target thing)
  352.                       (or target thing)
  353.                       (or target thing)) nil t)
  354.           (and not-quoted
  355.            (let ((case-fold-search t))
  356.              (search-forward (or target thing) nil t)))
  357.           (search-forward (format "`%s'" (or target thing)) nil t)
  358.           (search-forward (or target thing) nil t)))
  359.     (let ((case-fold-search t))
  360.       (or (search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\<The[ \n]`%s'"
  361.                       (or target thing)
  362.                       (or target thing)
  363.                       (or target thing)) nil t)
  364.           (search-forward (format "`%s'" (or target thing)) nil t)
  365.           (search-forward (or target thing) nil t))))
  366.     (beginning-of-line)
  367.     (message "Found `%s' in %s" thing where))
  368. )
  369.  
  370. (defun calc-view-news ()
  371.   (interactive)
  372.   (let ((path load-path))
  373.     (while (and path
  374.         (not (file-exists-p (expand-file-name "calc.el" (car path)))))
  375.       (setq path (cdr path)))
  376.     (or (and path
  377.          (file-exists-p (expand-file-name "README" (car path))))
  378.     (error "Can't locate Calc sources"))
  379.     (calc-quit)
  380.     (switch-to-buffer "*Help*")
  381.     (erase-buffer)
  382.     (insert-file-contents (expand-file-name "README" (car path)))
  383.     (search-forward "Summary of changes")
  384.     (forward-line -1)
  385.     (delete-region (point-min) (point))
  386.     (goto-char (point-min)))
  387. )
  388.  
  389.  
  390.  
  391. (defun calc-full-help ()
  392.   (interactive)
  393.   (with-output-to-temp-buffer "*Help*"
  394.     (princ (format "GNU Emacs Calculator version %s of %s.\n"
  395.            calc-version calc-version-date))
  396.     (princ "  By Dave Gillespie, daveg@synaptics.com.\n")
  397.     (princ (format "  Installed %s.\n" calc-installed-date))
  398.     (princ "  Copyright (C) 1990, 1993 Free Software Foundation, Inc.\n\n")
  399.     (princ "Type `h s' for a more detailed summary.\n")
  400.     (princ "Or type `h i' to read the full Calc manual on-line.\n\n")
  401.     (princ "Basic keys:\n")
  402.     (let* ((calc-full-help-flag t))
  403.       (mapcar (function (lambda (x) (princ (format "  %s\n" x))))
  404.           (nreverse (cdr (reverse (cdr (calc-help))))))
  405.       (mapcar (function (lambda (prefix)
  406.               (let ((msgs (funcall prefix)))
  407.                 (if (car msgs)
  408.                 (princ
  409.                  (if (eq (nth 2 msgs) ?v)
  410.                      "\n`v' or `V' prefix (vector/matrix) keys: \n"
  411.                    (if (nth 2 msgs)
  412.                        (format
  413.                     "\n`%c' prefix (%s) keys:\n"
  414.                     (nth 2 msgs)
  415.                     (or (cdr (assq (nth 2 msgs)
  416.                                calc-help-long-names))
  417.                         (nth 1 msgs)))
  418.                      (format "\n%s-modified keys:\n"
  419.                          (capitalize (nth 1 msgs)))))))
  420.                 (mapcar (function (lambda (x)
  421.                         (princ (format "  %s\n" x))))
  422.                     (car msgs)))))
  423.           '(calc-inverse-prefix-help
  424.         calc-hyperbolic-prefix-help
  425.         calc-inv-hyp-prefix-help
  426.         calc-a-prefix-help
  427.         calc-b-prefix-help
  428.         calc-c-prefix-help
  429.         calc-d-prefix-help
  430.         calc-f-prefix-help
  431.         calc-g-prefix-help
  432.         calc-h-prefix-help
  433.         calc-j-prefix-help
  434.         calc-k-prefix-help
  435.         calc-m-prefix-help
  436.         calc-r-prefix-help
  437.         calc-s-prefix-help
  438.         calc-t-prefix-help
  439.         calc-u-prefix-help
  440.         calc-v-prefix-help
  441.         calc-shift-Y-prefix-help
  442.         calc-shift-Z-prefix-help
  443.         calc-z-prefix-help)))
  444.     (print-help-return-message))
  445. )
  446.  
  447. (defvar calc-help-long-names '( ( ?b . "binary/business" )
  448.                 ( ?g . "graphics" )
  449.                 ( ?j . "selection" )
  450.                 ( ?k . "combinatorics/statistics" )
  451.                 ( ?u . "units/statistics" )
  452. ))
  453.  
  454. (defun calc-h-prefix-help ()
  455.   (interactive)
  456.   (calc-do-prefix-help
  457.    '("Help; Bindings; Info, Tutorial, Summary; News"
  458.      "describe: Key, C (briefly), Function, Variable")
  459.    "help" ?h)
  460. )
  461.  
  462. (defun calc-inverse-prefix-help ()
  463.   (interactive)
  464.   (calc-do-prefix-help
  465.    '("I + S (arcsin), C (arccos), T (arctan); Q (square)"
  466.      "I + E (ln), L (exp), B (alog: B^X); f E (lnp1), f L (expm1)"
  467.      "I + F (ceiling), R (truncate); a S (invert func)"
  468.      "I + a m (match-not); c h (from-hms); k n (prev prime)"
  469.      "I + f G (gamma-Q); f e (erfc); k B (etc., lower-tail dists)"
  470.      "I + V S (reverse sort); V G (reverse grade)"
  471.      "I + v s (remove subvec); v h (tail)"
  472.      "I + t + (alt sum), t M (mean with error)"
  473.      "I + t S (pop std dev), t C (pop covar)")
  474.    "inverse" nil)
  475. )
  476.  
  477. (defun calc-hyperbolic-prefix-help ()
  478.   (interactive)
  479.   (calc-do-prefix-help
  480.    '("H + S (sinh), C (cosh), T (tanh); E (exp10), L (log10)"
  481.      "H + F (float floor), R (float round); P (constant \"e\")"
  482.      "H + a d (total derivative); k c (permutations)"
  483.      "H + k b (bern-poly), k e (euler-poly); k s (stirling-2)"
  484.      "H + f G (gamma-g), f B (beta-B); v h (rhead), v k (rcons)"
  485.      "H + v e (expand w/filler); V H (weighted histogram)"
  486.      "H + a S (general solve eqn), j I (general isolate)"
  487.      "H + a R (widen/root), a N (widen/min), a X (widen/max)"
  488.      "H + t M (median), t S (variance), t C (correlation coef)"
  489.      "H + c f/F/c (pervasive float/frac/clean)")
  490.    "hyperbolic" nil)
  491. )
  492.  
  493. (defun calc-inv-hyp-prefix-help ()
  494.   (interactive)
  495.   (calc-do-prefix-help
  496.    '("I H + S (arcsinh), C (arccosh), T (arctanh)"
  497.      "I H + E (log10), L (exp10); f G (gamma-G)"
  498.      "I H + F (float ceiling), R (float truncate)"
  499.      "I H + t S (pop variance)"
  500.      "I H + a S (general invert func); v h (rtail)")
  501.    "inverse-hyperbolic" nil)
  502. )
  503.  
  504.  
  505. (defun calc-f-prefix-help ()
  506.   (interactive)
  507.   (calc-do-prefix-help
  508.    '("miN, maX; Hypot; Im, Re; Sign; [, ] (incr/decr)"
  509.      "Gamma, Beta, Erf, besselJ, besselY"
  510.      "SHIFT + int-sQrt; Int-log, Exp(x)-1, Ln(x+1); arcTan2"
  511.      "SHIFT + Abssqr; Mantissa, eXponent, Scale"
  512.      "SHIFT + incomplete: Gamma-P, Beta-I")
  513.    "functions" ?f)
  514. )
  515.  
  516.  
  517. (defun calc-s-prefix-help ()
  518.   (interactive)
  519.   (calc-do-prefix-help
  520.    '("Store, inTo, Xchg, Unstore; Recall, 0-9; : (:=); = (=>)"
  521.      "Let; Copy; Declare; Insert, Perm; Edit"
  522.      "Negate, +, -, *, /, ^, &, |, [, ]; Map"
  523.      "SHIFT + Decls, GenCount, TimeZone, Holidays; IntegLimit"
  524.      "SHIFT + LineStyles, PointStyles, plotRejects; Units"
  525.      "SHIFT + Eval-, AlgSimp-, ExtSimp-, FitRules")
  526.    "store" ?s)
  527. )
  528.  
  529. (defun calc-r-prefix-help ()
  530.   (interactive)
  531.   (calc-do-prefix-help
  532.    '("digits 0-9: recall, same as `s r 0-9'")
  533.    "recall" ?r)
  534. )
  535.  
  536.  
  537. (defun calc-j-prefix-help ()
  538.   (interactive)
  539.   (calc-do-prefix-help
  540.    '("Select, Additional, Once; eVal, Formula; Rewrite"
  541.      "More, Less, 1-9, Next, Previous"
  542.      "Unselect, Clear; Display; Enable; Breakable"
  543.      "' (replace), ` (edit), +, -, *, /, RET (grab), DEL"
  544.      "SHIFT + swap: Left, Right; maybe: Select, Once"
  545.      "SHIFT + Commute, Merge, Distrib, jump-Eqn, Isolate"
  546.      "SHIFT + Negate, & (invert); Unpack")
  547.    "select" ?j)
  548. )
  549.  
  550.  
  551. (defun calc-a-prefix-help ()
  552.   (interactive)
  553.   (calc-do-prefix-help
  554.    '("Simplify, Extended-simplify, eVal; \" (exp-formula)"
  555.      "eXpand, Collect, Factor, Apart, Norm-rat"
  556.      "GCD, /, \\, % (polys); Polint"
  557.      "Derivative, Integral, Taylor; _ (subscr)"
  558.      "suBstitute; Rewrite, Match"
  559.      "SHIFT + Solve; Root, miN, maX; Poly-roots; Fit"
  560.      "SHIFT + Map; Tabulate, + (sum), * (prod); num-Integ"
  561.      "relations: =, # (not =), <, >, [ (< or =), ] (> or =)"
  562.      "logical: & (and), | (or), ! (not); : (if)"
  563.      "misc: { (in-set); . (rmeq)")
  564.    "algebra" ?a)
  565. )
  566.  
  567.  
  568. (defun calc-b-prefix-help ()
  569.   (interactive)
  570.   (calc-do-prefix-help
  571.    '("And, Or, Xor, Diff, Not; Wordsize, Clip"
  572.      "Lshift, Rshift, roTate; SHIFT + signed Lshift, Rshift"
  573.      "SHIFT + business: Pv, Npv, Fv, pMt, #pmts, raTe, Irr"
  574.      "SHIFT + business: Sln, sYd, Ddb; %ch")
  575.    "binary/bus" ?b)
  576. )
  577.  
  578.  
  579. (defun calc-c-prefix-help ()
  580.   (interactive)
  581.   (calc-do-prefix-help
  582.    '("Deg, Rad, HMS; Float; Polar/rect; Clean, 0-9; %"
  583.      "SHIFT + Fraction")
  584.    "convert" ?c)
  585. )
  586.  
  587.  
  588. (defun calc-d-prefix-help ()
  589.   (interactive)
  590.   (calc-do-prefix-help
  591.    '("Group, \",\"; Normal, Fix, Sci, Eng, \".\"; Over"
  592.      "Radix, Zeros, 2, 8, 0, 6; Hms; Date; Complex, I, J"
  593.      "Why; Line-nums, line-Breaks; <, =, > (justify); Plain"
  594.      "\" (strings); Truncate, [, ]; SPC (refresh), RET"
  595.      "SHIFT + language: Normal, One-line, Big, Unformatted"
  596.      "SHIFT + language: C, Pascal, Fortran; TeX, Eqn"
  597.      "SHIFT + language: Mathematica, W=Maple")
  598.    "display" ?d)
  599. )
  600.  
  601.  
  602. (defun calc-g-prefix-help ()
  603.   (interactive)
  604.   (calc-do-prefix-help
  605.    '("Fast; Add, Delete, Juggle; Plot, Clear; Quit"
  606.      "Header, Name, Grid, Border, Key; View-commands, X-display"
  607.      "x-axis: Range, Title, Log, Zero; lineStyle"
  608.      "SHIFT + y-axis: Range, Title, Log, Zero; pointStyle"
  609.      "SHIFT + Print; Device, Output-file; X-geometry"
  610.      "SHIFT + Num-pts; Command, Kill, View-trail"
  611.      "SHIFT + 3d: Fast, Add; CTRL + z-axis: Range, Title, Log")
  612.    "graph" ?g)
  613. )
  614.  
  615.  
  616. (defun calc-k-prefix-help ()
  617.   (interactive)
  618.   (calc-do-prefix-help
  619.    '("GCD, LCM; Choose (binomial), Double-factorial"
  620.      "Random, random-Again, sHuffle"
  621.      "Factors, Prime-test, Next-prime, Totient, Moebius"
  622.      "Bernoulli, Euler, Stirling"
  623.      "SHIFT + Extended-gcd"
  624.      "SHIFT + dists: Binomial, Chi-square, F, Normal"
  625.      "SHIFT + dists: Poisson, student's-T")
  626.    "combinatorics" ?k)
  627. )
  628.  
  629.  
  630. (defun calc-m-prefix-help ()
  631.   (interactive)
  632.   (calc-do-prefix-help
  633.    '("Deg, Rad, HMS; Frac; Polar; Inf; Alg, Total; Symb; Vec/mat"
  634.      "Working; Xtensions; Mode-save"
  635.      "SHIFT + Shifted-prefixes, mode-Filename; Record; reCompute"
  636.      "SHIFT + simplify: Off, Num, Default, Bin, Alg, Ext, Units")
  637.    "mode" ?m)
  638. )
  639.  
  640.  
  641. (defun calc-t-prefix-help ()
  642.   (interactive)
  643.   (calc-do-prefix-help
  644.    '("Display; Fwd, Back; Next, Prev, Here, [, ]; Yank"
  645.      "Search, Rev; In, Out; <, >; Kill; Marker; . (abbrev)"
  646.      "SHIFT + time: Now; Part; Date, Julian, Unix, Czone"
  647.      "SHIFT + time: newWeek, newMonth, newYear; Incmonth"
  648.      "SHIFT + time: +, - (business days)"
  649.      "digits 0-9: store-to, same as `s t 0-9'")
  650.    "trail/time" ?t)
  651. )
  652.  
  653.  
  654. (defun calc-u-prefix-help ()
  655.   (interactive)
  656.   (calc-do-prefix-help
  657.    '("Simplify, Convert, Temperature-convert, Base-units"
  658.      "Autorange; Remove, eXtract; Explain; View-table; 0-9"
  659.      "Define, Undefine, Get-defn, Permanent"
  660.      "SHIFT + View-table-other-window"
  661.      "SHIFT + stat: Mean, G-mean, Std-dev, Covar, maX, miN"
  662.      "SHIFT + stat: + (sum), - (asum), * (prod), # (count)")
  663.    "units/stat" ?u)
  664. )
  665.  
  666.  
  667. (defun calc-v-prefix-help ()
  668.   (interactive)
  669.   (calc-do-prefix-help
  670.    '("Pack, Unpack, Identity, Diagonal, indeX, Build"
  671.      "Row, Column, Subvector; Length; Find; Mask, Expand"
  672.      "Tranpose, Arrange, reVerse; Head, Kons; rNorm"
  673.      "SHIFT + Det, & (inverse), LUD, Trace, conJtrn, Cross"
  674.      "SHIFT + Sort, Grade, Histogram; cNorm"
  675.      "SHIFT + Apply, Map, Reduce, accUm, Inner-, Outer-prod"
  676.      "SHIFT + sets: V (union), ^ (intersection), - (diff)"
  677.      "SHIFT + sets: Xor, ~ (complement), Floor, Enum"
  678.      "SHIFT + sets: : (span), # (card), + (rdup)"
  679.      "<, =, > (justification); , (commas); [, {, ( (brackets)"
  680.      "} (matrix brackets); . (abbreviate); / (multi-lines)")
  681.    "vec/mat" ?v)
  682. )
  683.  
  684.